<%@ page import="com.studentachievement.beans.Score" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>分数查询结果</title>
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background: linear-gradient(135deg, #4CAF50, #66BB6A);
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
        }

        .container {
            background-color: #ffffff;
            padding: 40px;
            border-radius: 12px;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 900px;
            text-align: center;
        }

        h1 {
            color: #4CAF50;
            font-size: 32px;
            margin-bottom: 20px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
        }

        h2 {
            color: #555;
            font-size: 20px;
            margin-bottom: 30px;
        }

        table {
            width: 100%;
            margin: 20px 0;
            border-collapse: collapse;
            background-color: #fff;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        th, td {
            padding: 12px;
            text-align: center;
            border: 1px solid #ddd;
        }

        th {
            background-color: #4CAF50;
            color: white;
            font-size: 18px;
        }

        td {
            color: #333;
            font-size: 16px;
        }

        tr:nth-child(even) {
            background-color: #f9f9f9;
        }

        tr:hover {
            background-color: #f1f1f1;
        }

        .no-data {
            font-size: 18px;
            color: #888;
            font-style: italic;
            margin-top: 20px;
        }

        .button-link {
            display: inline-block;
            padding: 12px 24px;
            background-color: #4CAF50;
            color: white;
            text-align: center;
            text-decoration: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: bold;
            transition: background-color 0.3s, box-shadow 0.3s;
            margin-top: 20px;
        }

        .button-link:hover {
            background-color: #45a049;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        }
    </style>
</head>
<body>
<div class="container">
    <h1>成绩信息</h1>
    <hr>
    <%
        Score score = (Score) request.getAttribute("score");
        if (score != null) {
    %>
    <table>
        <tr>
            <th>学号</th>
            <th>学生名</th>
            <th>课程名</th>
            <th>成绩</th>
            <th>考试时间</th>
        </tr>
        <tr>
            <td><%= score.getStudentId() %></td>
            <td><%= score.getStudentName() %></td>
            <td><%= score.getCourseName() %></td>
            <td><%= score.getScore() %></td>
            <td><%= score.getExamDate() %></td>
        </tr>
    </table>
    <%
    } else { // 如果没有找到成绩
    %>
    <h2 class="no-data">没有查询到此成绩</h2>
    <%
        }
    %>
    <a href="${pageContext.request.contextPath}/AdminHomeServlet" class="button-link">返回主页</a>
</div>
</body>
</html>
